<template>
<!--可复用的表格组件-->
		<section>
			<el-table  :data="tableData" border style="width: 100%">
				<el-table-column label="序号" align="center" width = "80">
					 <template slot-scope='scope' >
				          {{scope.$index}}
				        </template>
				</el-table-column>
				
				<el-table-column 
					v-for = "(val,key) in labelList"
					 :label='val'
				     :key='key'
				     :prop='key'
				     align="center"
					></el-table-column>
				
				<el-table-column label="操作" align="center">
					 <template slot-scope='scope'>
				          <el-button
				            type='text'
				            @click='checkView(scope)'
				          >详情</el-button>
				          
				          <el-button
				          	v-if="type==='mydan' && scope.row.orderEndTime!=null && scope.row.orderEndTime!='' &&scope.row.status!='yipingjia'"
				            type='text'
				            @click='checkPingjia(scope)'
				          >评分</el-button>
				        </template>
				</el-table-column>
				
				<!--<el-table-column v-if="type==='mydan'"label="评价"  align="center">
					 <template slot-scope='scope'>
				          <el-button
				            type='text'
				            @click='checkPingjia(scope)'
				          >评分</el-button>
				        </template>
				</el-table-column>-->
			</el-table>
			    <el-pagination 
			      @current-change="handleCurrentChange"
			      :current-page.sync="currentPage3"
			      :page-size="Number(pageSize)"
			      layout="prev, pager, next, jumper"
			      :total="Number(pageTotal)">
			 </el-pagination> 
		</section>
</template>

<script>
	export default {
    	props:{
    		tableData:Array,
    		labelList:Object,
    		type:'',
    		pageSize:'',
    		pageTotal:'',
    	},
    	data(){
    		return {
    			
    		}
    	},
    	methods:{
    		checkView(val){/*查看详情*/
    			console.log(val);
    			if(this.type=='waitdan'){
    				this.$emit('checkView',{formId:val.row.formId,taskId:val.row.id});
    			}else if(this.type==='mydan'){
    				console.log(val);
    				this.$emit('checkView',{formId:val.row.id,taskId:''});
    			}
    			
    		},
    		checkPingjia(val){/*查看评分*/
    			console.log(val);
    			 this.$emit('checkPingjia',val.row);
    		},
    		handleCurrentChange(val){
//  			console.log(`当前:${val}`);
    			this.$emit("gotoPage",val);
    		}
    	}
    }
</script>

<style >

</style>